home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: Jan. 6, 97
- // Author: ap
- //
- // Description: defines behaviour and layout of ik handle portion
- // of the jointContext tool property sheet
- //
-
-
- global proc ikHandlePropCallback(string $parent, string $whichCallback)
- //
- // Procedure Name:
- // ikHandlePropCallback
- //
- // Description:
- // Callbacks for the IK Handle Tool Property Sheet in joint tool.
- //
- // Input Arguments:
- // Parent name, and
- // current callback name.
- //
- // Return Value:
- // None.
- //
- {
- setParent $parent;
- string $whichCtx = `currentCtx`;
-
- switch ($whichCallback)
- {
- case "selectedIKSolver":
- string $solverName = `optionMenuGrp -q -value ikHandleOptionMenu`;
- jointCtx -e -solverTypeH $solverName $whichCtx;
- break;
-
- case "autoPriorityOn":
- intSliderGrp -e -enable false priority;
- jointCtx -e -autoPriorityH true $whichCtx;
- break;
-
- case "autoPriorityOff":
- intSliderGrp -e -enable true priority;
- jointCtx -e -autoPriorityH false $whichCtx;
- break;
-
- case "snapHandleHOn":
- jointCtx -e -snapHandleH true $whichCtx;
- break;
-
- case "snapHandleHOff":
- jointCtx -e -snapHandleH false $whichCtx;
- break;
-
- case "forceSolverHOn":
- jointCtx -e -forceSolverH true $whichCtx;
- break;
-
- case "forceSolverHOff":
- jointCtx -e -forceSolverH false $whichCtx;
- break;
-
- case "stickyHOn":
- jointCtx -e -stickyH sticky $whichCtx;
- break;
-
- case "stickyHOff":
- jointCtx -e -stickyH off $whichCtx;
- break;
-
- case "priorityHValue":
- int $p = `intSliderGrp -q -v priority`;
- jointCtx -e -priorityH $p $whichCtx;
- break;
-
- case "weightHValue":
- float $w = `floatSliderGrp -q -v handleWeight`;
- jointCtx -e -weightH $w $whichCtx;
- break;
-
- case "poWeightHValue":
- float $pow = `floatSliderGrp -q -v handlePOWeight`;
- jointCtx -e -poWeightH $pow $whichCtx;
- break;
-
- default:
- break;
- }
- }
-
-
- global proc ikHandleSetCallbacks (string $parent)
- //
- // Procedure Name:
- // ikHandleSetCallbacks
- //
- // Description:
- // associate control events with callbacks
- //
- // Input Arguments:
- // parent name.
- //
- // Return Value:
- // None.
- //
- {
- setParent $parent;
-
- optionMenuGrp -e
- -cc `CBG "ikHandleProp" $parent "selectedIKSolver"`
- ikHandleOptionMenu;
-
- checkBoxGrp -e
- -on1 `CBG "ikHandleProp" $parent "autoPriorityOn"`
- -of1 `CBG "ikHandleProp" $parent "autoPriorityOff"`
- autoPriorityGrp;
-
- checkBoxGrp -e
- -on1 `CBG "ikHandleProp" $parent "snapHandleHOn"`
- -of1 `CBG "ikHandleProp" $parent "snapHandleHOff"`
- snapHandleGrp;
-
- checkBoxGrp -e
- -on1 `CBG "ikHandleProp" $parent "forceSolverHOn"`
- -of1 `CBG "ikHandleProp" $parent "forceSolverHOff"`
- forceSolverGrp;
-
- //=====================================================
- // For maya1.0, there is not superSticky yet. So in UI,
- // use checkBox to turn on/off sticky.
- //
- // Use radioButtonGrp when implementing superSticky.
- //=====================================================
- //radioButtonGrp -e
- // -on1 `CBG "ikHandleProp" $parent "stickyOff"`
- // -on2 `CBG "ikHandleProp" $parent "stickySticky"`
- // -on3 `CBG "ikHandleProp" $parent "stickySuperSticky"`
- // stickyGrp;
- checkBoxGrp -e
- -on1 `CBG "ikHandleProp" $parent "stickyHOn"`
- -of1 `CBG "ikHandleProp" $parent "stickyHOff"`
- stickyGrp;
-
- intSliderGrp -e
- -cc `CBG "ikHandleProp" $parent "priorityHValue"`
- priority;
-
- floatSliderGrp -e
- -cc `CBG "ikHandleProp" $parent "weightHValue"`
- handleWeight;
-
- floatSliderGrp -e
- -cc `CBG "ikHandleProp" $parent "poWeightHValue"`
- handlePOWeight;
-
- return;
- }
-
-
- global proc ikHandleOptionLayout(string $parentN, int $cl )
- //
- // Procedure Name:
- // ikHandleOptionLayout
- //
- // Description:
- // jointTool property sheet shares this proc to create ikHandle part.
- //
- {
- string $parent;
- string $solvers[];
- string $solverType;
- int $itemNum;
- int $i;
-
- setParent $parentN;
-
- setUITemplate -pushTemplate OptionsTemplate;
-
- frameLayout -cll true -cl $cl -l "IK Handle Settings" ikHandleFrame;
- columnLayout ikHandleOptions;
- separator -style "none";
- $parent = `setParent -query`;
-
- optionMenuGrp -l "Current Solver" ikHandleOptionMenu;
- $solvers = `ikSystem -q -ls`;
- $itemNum = 0;
- for( $i = 0; $i < size($solvers); $i++ )
- {
- $solverType = `objectType $solvers[$i]`;
- if( $solverType != "ikSplineSolver" )
- {
- menuItem -l $solvers[$i] ($solvers[$i] + $itemNum);
- $itemNum++;
- }
- }
-
- separator -hr true sep1;
-
- checkBoxGrp
- -label ""
- -numberOfCheckBoxes 1
- -l1 "Autopriority"
- autoPriorityGrp;
-
- checkBoxGrp
- -label ""
- -numberOfCheckBoxes 1
- -l1 "Solver Enable"
- forceSolverGrp;
-
- checkBoxGrp
- -label ""
- -numberOfCheckBoxes 1
- -l1 "Snap Enable"
- snapHandleGrp;
-
- //=====================================================
- // For maya1.0, there is not superSticky yet. So in UI,
- // use checkBox to turn on/off sticky.
- //
- // Use radioButtonGrp when implementing superSticky.
- //=====================================================
- //radioButtonGrp
- // -label "Stickies "
- // -numberOfRadioButtons 3
- // -labelArray3 "Off" "Sticky" "Super Sticky"
- // -columnWidth4 150 80 80 120
- // stickyGrp;
- checkBoxGrp
- -label ""
- -numberOfCheckBoxes 1
- -l1 "Sticky"
- stickyGrp;
-
- separator -hr true sep2;
-
- intSliderGrp
- -field 1
- -label "Priority"
- -minValue 0
- -value 1
- priority;
-
- floatSliderGrp
- -field 1
- -label "Weight"
- -minValue 0.0
- -maxValue 100.0
- -step 0.1
- -value 1.0
- handleWeight;
-
- floatSliderGrp
- -field 1
- -label "POWeight"
- -minValue 0.0
- -maxValue 1.0
- -step 0.001
- -value 1.0
- handlePOWeight;
-
- setParent ..; // ikHandleOptions
- setParent ..; // ikHandleFrame
-
- setUITemplate -popTemplate;
-
- ikHandleSetCallbacks( $parent );
-
- clear($solvers);
-
- return;
- }
-